package xyz.awesomeman.controller;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import xyz.awesomeman.service.UserService;
import xyz.awesomeman.service.UserServiceImpl;

@RestController
public class UserController {
	private static Logger log = LogManager.getLogger(UserController.class);
	@Autowired
	UserService userService;
//	读取配置文件数据
	@Value("${url}")
	String url;
	@RequestMapping("/adduser1/{username}/{password}")
	public String addUser1(@PathVariable String username,@PathVariable String password) {
		
		userService.addUser1(username, password);
		return "success";
	}
	@RequestMapping("/adduser2/{username}/{password}")
	public String addUser2(@PathVariable String username,@PathVariable String password) {
		userService.addUser2(username, password);
		return "success";
	}
	@RequestMapping("/adduser3/{username}/{password}")
	public String adduser3(@PathVariable String username,@PathVariable String password) {
		//log.info("123");
		userService.addUser3(username, password);
		return "success";
	}
	@RequestMapping("/getValue")
	public String getValue() {
		return url;
	}
}
